<?php
class stFacebookMessage_model extends stmodel_2_1{

    public function __construct($config) {
        parent::__construct ( $config );
        $this->setTableName('st_likepluginfbmessages');
        $this->setPrimaryKey('messageid');
    }
    public function get_user($id){
    	return json_decode(file_get_contents('http://graph.facebook.com/'.$id));
    }
    public function get_term($id){
    	global $wpdb;
    	return $wpdb->get_var("SELECT searchterm FROM st_likepluginsearchterms WHERE searchtermid=".$id);
    }
    public function get_user_model($id)
    {
    	global $wpdb;
    	$user = $wpdb->get_row("SELECT firstname,lastname FROM st_likepluginfbusers WHERE uid=".$id); 
    	return $user->firstname.' '.$user->lastname;
    }
    public function get_color($id)
    {
    	global $wpdb;
    	return $wpdb->get_var("SELECT flagcolorcode FROM fbt_flagtypes WHERE flagtypeid=".$id);
    }



}